#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <algorithm>

using namespace std;

struct TreeNode {
	int val;
	TreeNode *left;
	TreeNode *right;
	TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};

int maxDepth(TreeNode *root) {
	if (!root)
		return 0;

	return max<int>(maxDepth(root->left), maxDepth(root->right)) + 1;
}

int main()
{

	system("pause");
	return 0;
}